package com.feri.rbacsys.controller;

import com.feri.rbacsys.entity.Buyorder;
import com.feri.rbacsys.service.BuyorderService;
import com.feri.rbacsys.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/buyorder/")
@Api(tags = "采购的各种接口")
public class BuyorderController {
    @Resource
    private BuyorderService service;

    @PostMapping("purchasegoods")
    @ApiOperation("采购")
    public R purchaseGoods(@RequestBody Buyorder buyorder) {
        return R.ok(service.purchaseGoods(buyorder));
    }

    @GetMapping("all")
    @ApiOperation("查询所有")
    public R selectAll() {
        return R.ok(service.selectAll());
    }
}
